package com.practice.springboot.dubbo.consumer.controller;

import com.practice.spring.boot.dubbo.api.IDemoUserService;
import com.practice.spring.boot.dubbo.entity.MybatisDemoUser;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yangdejun
 */
@RestController
public class DemoConsumerController {

    @DubboReference(group = "dev", version = "1.0.0")
    private IDemoUserService demoService;

    @RequestMapping("/findAll")
    public List<MybatisDemoUser> findAll() {
        return demoService.findAll();
    }
}
